# -*- encoding: utf-8 -*-
"""

PyCharm 全排列问题通过使用迭代解决
2024年10月26日14时34分
by wenyang

文件主要内容:


"""
res = []
for i in list(range(1, 6)):
    list_two = [j for j in list(range(1, 6)) if j != i]
    for j in list_two:
        list_three = [k for k in list_two if k != j]
        for k in list_three:
            list_four = [l for l in list_three if l != k]
            for l in list_four:
                list_five = [m for m in list_four if m != l]
                for m in list_five:
                    res.append([i, j, k, l, m])



def main():
    print(res)


if __name__ == "__main__":
    main()
